In [1]:
%%bash
. ~/.bashrc
pip install --upgrade git+https://git@github.com/JonasWallin/linkingEC2
In [2]:
## short tutorial on running MPI4py on EC2
from ConfigParser import ConfigParser
config = ConfigParser()
starfigconfig_folder = "/Users/jonaswallin/.starcluster/"
config.read(starfigconfig_folder + "config")
acess_key_id = config.get('aws info', 'aws_access_key_id' , 0)
aws_secret_key = config.get('aws info', 'aws_secret_access_key', 0)
aws_region_name = config.get('aws info', 'aws_region_name' , 0)
my_key_loc = config.get('key mykeyABC', 'key_location',0)
from linkingEC2 import LinkingHandler
linker = LinkingHandler(aws_secret_access_key = aws_secret_key,
aws_access_key_id = acess_key_id,
aws_region_name = aws_region_name,
key_location = my_key_loc,
key_name = 'mykeyABC')
linker.start_cluster('ami-d05e75b8', 't2.micro', ['linking_EC2'],1)
In [5]:
import time
PACKAGES_APT = ['python-dev', 'openmpi-bin', 'libopenmpi-dev', 'python-numpy','git']
PACKAGES_PIP = ['mpi4py','cython']
time_in = time.time()
linker.apt_install(PACKAGES_APT)
linker.pip_install(PACKAGES_PIP)
time_out = time.time()
import os
os.system('say "your packages is downloaded"')
print('it took {time:.2f} sec'.format(time = time_out - time_in))
In [28]:
linker.pip_install(["-e 'git+https://git@github.com/JonasWallin/rtnorm.git#egg=rtnorm&subdirectory=python/rtnorm' "])
Out[28]:
In [29]:
print( linker.get_ssh_login() ) # print( linker.get_ssh_login(1) )
In [ ]: